// import '../../assets/video-alpha';
var sceneReadyBehavior = require('../behavior-scene/scene-ready');

Page({
  behaviors: [sceneReadyBehavior],
  data: {
    colList: [{
      id: 'resce1',
      type: '2dtracking',
      markerImg: 'https://testar.yishuerweima.com/uploads/20240807/406424a45be9526939b95bd12ba7b3ef.jpg',
      resources: ['resgltf1', 'resgltf11']
    },
    {
      id: 'resce2',
      type: '2dtracking',
      markerImg: 'https://testar.yishuerweima.com/uploads/20240807/94ed92b25e4c69c8cf055e69de18d0c2.jpg',
      resources: ['resgltf2']
    },
    {
      id: 'resce3',
      type: '2dtracking',
      markerImg: 'https://testar.yishuerweima.com/uploads/20240803/cc5a376ffa4a6ce853c380122319f772.jpg',
      resources: ['resvideo1']
    },
    {
      id: 'resce4',
      type: '2dtracking',
      markerImg: 'https://testar.yishuerweima.com/uploads/20240802/df055f285d6b95d78e769b5ac49d9547.jpg',
      resources: ['resvideo2']
    },
    {
      id: 'resce5',
      type: '2dtracking',
      markerImg: 'https://testar.yishuerweima.com/uploads/20240807/10019c867d9f7fbda111a25c581f0f07.jpg',
      resources: ['resimg2']
    }
    ],
    gltfList: [
      {
        id: 'resgltf1',
        src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb',
        position: {
          x: 0.2,
          y: 0,
          z: -0.2
        },
        rotation: {
          x: 0,
          y: -50,
          z: 0
        },
        scale: 0.6,
        visiable: true
      }, {
        id: 'resgltf11',
        src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb',
        position: {
          x: 0.4,
          y: 0,
          z: 0.3
        },
        rotation: {
          x: 0,
          y: -50,
          z: 0
        },
        scale: 0.5,
        visiable: true
      }, {
        id: 'resgltf2',
        src: 'https://testar.yishuerweima.com/uploads/20240731/test.glb',
        position: {
          x: 0.4,
          y: 0,
          z: 0.3
        },
        rotation: {
          x: 0,
          y: -50,
          z: 0
        },
        scale: 0.5
      }, {
        id: 'resgltf3',
        src: 'https://testar.yishuerweima.com/uploads/20240731/huGLTF1.gltf',
        position: {
          x: 0.2,
          y: 0,
          z: -0.2
        },
        rotation: {
          x: 0,
          y: -50,
          z: 0
        },
        scale: "1,0.9,0.9",
        width: 400,
        heigth: 500
      }
    ],
    imageList: [
      {
        id: 'resimg1',
        src: 'https://testar.yishuerweima.com/uploads/20240803/cc5a376ffa4a6ce853c380122319f772.jpg',
        position: {
          x: 0.2,
          y: 0,
          z: -0.2
        },
        rotation: {
          x: 0,
          y: -50,
          z: 0
        },
        scale: 0.6,
        visiable: true
      }, {
        id: 'resimg2',
        src: 'https://testar.yishuerweima.com/uploads/20240802/df055f285d6b95d78e769b5ac49d9547.jpg',
        position: {
          x: 0.4,
          y: 0,
          z: 0.3
        },
        rotation: {
          x: 0,
          y: -50,
          z: 0
        },
        scale: 0.5
      }, {
        id: 'resimg3',
        src: 'https://testar.yishuerweima.com/uploads/20240731/7f910309cd1f8585681c43bc216d6ae0.png',
        position: {
          x: -0.3,
          y: 0,
          z: 0.3
        },
        rotation: {
          x: 0,
          y: -50,
          z: 0
        },
        scale: 0.4
      },
      {
        id: 'resimg4',
        src: 'https://testar.yishuerweima.com/uploads/20240805/60e3437266eeb3717a5f3370c2021f5d.png',
        position: {
          x: -0.8,
          y: 0.3,
          z: 0
        },
        rotation: {
          x: 0,
          y: 0,
          z: 0
        },
        scale: 3.5
      }
    ],
    videoList: [{
      id: 'resvideo1',
      // src: 'https://testar.yishuerweima.com/uploads/20240731/normal.mp4',
      src: 'https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/xr-frame-team/2dmarker/hikari-v.mp4',
      type: 'normal',
      position: {
        x: 0.2,
        y: 0,
        z: -0.2
      },
      rotation: {
        x: 0,
        y: -50,
        z: 0
      },
      scale: "1,0.9,0.9",
      loop: 'true',
      autoplay: 'true',
      width: 400,
      height: 500
    }, {
      id: 'resvideo2',
      src: 'https://testar.yishuerweima.com/uploads/20240731/alpha.mp4',
      // src: 'https://testar.yishuerweima.com/uploads/20240731/normal.mp4',
      type: 'alpha',
      position: {
        x: 0.2,
        y: 0,
        z: -0.2
      },
      rotation: {
        x: 0,
        y: -50,
        z: 0
      },
      scale: "1,0.9,0.9",
      loop: true,
      autoplay: true,
      width: 400,
      height: 500
    }],
    debugMsg: 'Defalut Words',
  },
  handleTrackerChange(cur) {
    const item = cur.detail;
    this.setData({
      debugMsg: 'handleTrackerChange:' + item.name
    })
  },
  tracked() {
    console.log('page tracked',);
    this.setData({
      arTrackerState: 'tracked'
    })
  },
  lostTrack() {
    console.log('page lostTrack');
    this.setData({
      arTrackerState: 'isTracking'
    })
  },
  handleARTrackerError({ detail }) {
    console.log('page handleARTrackerError', detail);
  }
});